package com.walming.generator.support.query;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.walming.generator.copycat.annotaion.Eq;
import com.walming.generator.copycat.annotaion.Like;
import com.walming.generator.copycat.annotaion.Time;
import com.walming.generator.copycat.enums.CompareEnum;
import com.walming.generator.copycat.enums.TimeQueryFormat;
import com.walming.generator.copycat.extend.AbstractQuery;
import com.walming.generator.support.domain.GenTable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * <p>
 * 代码生成业务表查询参数
 * </p>
 *
 * @author walming
 * @date 2020-11-07 18:07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "GenTableQuery", description = "代码生成业务表查询参数")
public class GenTableQuery extends AbstractQuery<GenTable> {

    @Eq
    @ApiModelProperty("主键")
    private Long tableId;

    @Eq
    @ApiModelProperty("数据源主键")
    private Long dataSourceId;

    @Eq
    @ApiModelProperty("数据源类型")
    private String dbType;

    @Like
    @ApiModelProperty("表名称")
    private String tableName;

    @Like
    @ApiModelProperty("表描述")
    private String tableComment;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Time(alias = "create_time", compare = CompareEnum.GE, format = TimeQueryFormat.DAY_BEGIN)
    @ApiModelProperty(value = "开始时间段", position = 10)
    private Date beginTime;
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Time(alias = "create_time", compare = CompareEnum.LE, format = TimeQueryFormat.DAY_END)
    @ApiModelProperty(value = "结束时间段", position = 11)
    private Date endTime;

}
